package com.lzn.dds.common;

/**
 * @author lzn
 * @date 6/10/21 8:51 PM
 */
public class RestfulResponse<T> {
    private String code;
    private String message;
    private T data;
    public RestfulResponse(){

    }
    public RestfulResponse(T data){
        this.code = "0";
        this.message = "";
        this.data = data;
    }
    public RestfulResponse(String code,String message,T data){
        this.code = code;
        this.message = message;
        this.data = data;
    }
    public RestfulResponse(String code,String message){
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
    public Boolean isSuccess(){
        return "0".equals(this.code);
    }
}
